// custom-tab-bar/index.js
const app = getApp()

Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selectIndex: 0,
    isOld: false,
    list: [{
      "pagePath": "/pages/billPage/home/index",
        "text": "预约",
        "iconPath": "/images/tabar/home_icon_yuyue_nor.png",
        "selectedIconPath": "/images/tabar/home_icon_yuyue_pre.png",
      },
      {
        "pagePath": "/pages/billPage/scan/index",
        "text": "扫码核销",
        "iconPath": "/images/tabar/scan_icon_nor.png",
        "selectedIconPath": "/images/tabar/scan_icon_pre.png",
      },
      {
        "pagePath": "/pages/billPage/client/index",
        "text": "客户",
        "iconPath": "/images/tabar/home_icon_kehu_nor.png",
        "selectedIconPath": "/images/tabar/home_icon_kehu_pre.png",
      }
    ],
    oldList: [{
      "pagePath": "/pages/paaPage/home/index",
      "text": "预约",
      "iconPath": "/images/tabar/home_icon_yuyue_nor.png",
      "selectedIconPath": "/images/tabar/home_icon_yuyue_pre.png",
    },
      {
        "pagePath": "/pages/paaPage/client/index",
        "text": "客户",
        "iconPath": "/images/tabar/home_icon_kehu_nor.png",
        "selectedIconPath": "/images/tabar/home_icon_kehu_pre.png",
      }]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    clickTabBarAction(e) {
      let {index, url} = e.currentTarget.dataset;
      if (this.data.selectIndex == index) return
      wx.switchTab({url})
      this.setData({
        selectIndex: index
      })
    }
  }
})